home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_pru_torchlight2.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  91 lines

  1. # Jones 3D Cog Script
  2. #
  3. # PRU_torchlight2.cog
  4. #    An alternative to gen_torchlight if hardcoded values are preferable.
  5. #    Indy reach animation plays dependent on value of reach. Flame is present but invisible at startup 
  6. #    Best use: Rename for target level and adjust hardcoded values as required. 
  7. #
  8. # [SXC] [RKD] [GGJ]
  9. #
  10. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  11. #
  12. # ========================================================================================
  13. symbols
  14.  
  15. message     activated
  16. message     startup
  17.  
  18. thing       torch                //the thing you light
  19. thing       flame    nolink        //flame, hidden at startup
  20. thing        dynalite            //dynamic light (to control where light is cast)
  21. thing        otherthing            //item that gets highlighted
  22. thing        player        local
  23.  
  24. keyframe    liteMed=in_light_stuff.key            local
  25. keyframe    liteHi=in_light_stuff_high.key        local
  26.  
  27. sound       burning=gen_torch_burnin_c.wav  local
  28. sound       fwoosh=gen_torchlitet_c.wav     local
  29.  
  30. vector      minlite        local
  31. vector      maxlite        local
  32.  
  33. flex        minradius=0.3    local
  34. flex        maxradius=0.3    local
  35. flex        dynaradius=1.0
  36.             
  37. flex        reach=0                        //0 for medium, 1 for high
  38. flex        islit=0            local        //set to 1 if torch lights at startup
  39. flex        flicker=1                    //set to 0 to eliminate flicker
  40. end
  41.  
  42. # ========================================================================================
  43. code
  44.  
  45. startup:
  46.     player = GetLocalPlayerThing();
  47.     minlite = VectorSet(0.8, 0.4, 0.1);
  48.     maxlite = VectorSet(0.9, 0.6, 0.4);    
  49.     SetThingFlags(flame, 0x10);
  50.     SetThingLight(torch, VectorSet(0.0, 0.0, 0.0), 0.3, 0.1);
  51.     return;
  52. # ........................................................................................
  53. activated:
  54.     if (islit) return;
  55.     if (GetSenderRef() != torch) return;
  56.     if ((GetCurWeapon(player) != 13) && (!InEditor())) return;
  57.     islit = 1;
  58.         
  59.     StartCutscene(1);
  60.     StopThing(Player);
  61.     SetActorFlags(player, 0x200000);
  62.     if (reach == 0)
  63.     {
  64.         PlayKey(player, liteMed, 4, 0x12, 1);
  65.     }
  66.     else if (reach == 1)
  67.     {
  68.         PlayKey(player, litehi, 4, 0x12, 1);
  69.     }
  70.     ClearActorFlags(player, 0x200000);
  71.     EndCutscene();
  72.  
  73.     ClearThingFlags(flame, 0x10);
  74.     PlaySoundThing(fwoosh, torch, 0.4, 3, 10, 0);
  75.     SetThingLight(torch, minlite, 0.3, 0.5);                           
  76.     if (dynalite)
  77.     {
  78.         SetThingLight(dynalite, maxlite, dynaradius, 0.5);
  79.         #ThingLightAnim(dynalite, minlite, minradius, maxlite, maxradius, 2);
  80.     }
  81.     if (otherthing)
  82.     {
  83.         SetThingLight(otherthing, maxlite, 0.01, 0.5);
  84.         #ThingLightAnim(dynalite, minlite, minradius, maxlite, maxradius, 2);
  85.     }
  86.     PlaySoundThing(burning, torch, 1, 3, 10, 1);
  87.     
  88.     if (flicker == 0) return;
  89.     ThingLightAnim(torch, minlite, minradius, maxlite, maxradius, 2);
  90.     return;
  91. end